package edu.sctu.renpingan.day20150628alltest;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

/**
 * Created by Administrator on 2015/6/28.
 */
public class JsonResolve {
    public Appbean getresolve(String json) {


        Appbean appbean0 = new Appbean();

        JSONObject jsonObject = JSON.parseObject(json);
        JSONArray array = (JSONArray) jsonObject.get("list");

        for (int i = 0; i < array.size(); i++) {
            JSONObject Object = array.getJSONObject(i);
            Goodss goodss = new Goodss();

            goodss.goods_name = Object.getString("goods_name");
            goodss.goods_price = Object.getString("goods_price");


            appbean0.list.add(goodss);

        }
        return appbean0;
    }

}
